<?php
require_once ("includes/table-main.php");

class Table_main_comment extends Table_main{
	
function Table_main_comment(){
	$this->items_a_page = 20;
	$this->Table_main('comments');	
}
	
function mysql_string(){
	return 'SELECT * FROM comment ORDER BY date_created DESC';	
}

function main(){
	$html = <<<HTML
	<div class="entry">                
    %s
	</div>
	%s
HTML;

	return sprintf($html,$this->table_rows(),$this->navigator());
}
	
function a_row($num_row,$num_item,$data){
	$html = <<<HTML
	<user>%s: </user>%s<br />
HTML;
	
	return sprintf($html,mysql_get_username($data['user_id']),$data['content']);
}
}

$_table_main_comment = new Table_main_comment();
$_table_main_comment->html();

?>